/*
 * Copyright (c) 2006-2018, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author            Notes
 * 2018-08-14    flybreak           the first version
 * 2018-09-18    balanceTWK         add sleep mode function 
 */

#ifndef __DRV_LCD_H__
#define __DRV_LCD_H__

#include <zos_config.h>


//POINT_COLOR
#define WHITE            0xFFFF
#define BLACK            0x0000
#define BLUE             0x001F
#define BRED             0XF81F
#define GRED             0XFFE0
#define GBLUE            0X07FF
#define RED              0xF800
#define MAGENTA          0xF81F
#define GREEN            0x07E0
#define CYAN             0x7FFF
#define YELLOW           0xFFE0
#define BROWN            0XBC40
#define BRRED            0XFC07
#define GRAY             0X8430
#define GRAY175          0XAD75
#define GRAY151          0X94B2
#define GRAY187          0XBDD7
#define GRAY240          0XF79E


zos_err_t lcd_init(void);
void lcd_clear(zos_uint16_t color);
void lcd_address_set(zos_uint16_t x1, zos_uint16_t y1, zos_uint16_t x2, zos_uint16_t y2);
void lcd_set_color(zos_uint16_t back, zos_uint16_t fore);

void lcd_draw_point(zos_uint16_t x, zos_uint16_t y,zos_uint16_t color);
void lcd_draw_circle(zos_uint16_t x0, zos_uint16_t y0, zos_uint8_t r,zos_uint16_t color);
void lcd_draw_line(zos_uint16_t x1, zos_uint16_t y1, zos_uint16_t x2, zos_uint16_t y2,zos_uint16_t color);
void lcd_draw_rectangle(zos_uint16_t x1, zos_uint16_t y1, zos_uint16_t x2, zos_uint16_t y2,zos_uint16_t color);
void lcd_fill(zos_uint16_t x_start, zos_uint16_t y_start, zos_uint16_t x_end, zos_uint16_t y_end, zos_uint16_t color);

void lcd_show_num(zos_uint16_t x, zos_uint16_t y, zos_uint32_t num, zos_uint8_t len, zos_uint32_t size);
zos_err_t lcd_show_string(zos_uint16_t x, zos_uint16_t y, zos_uint32_t size, const char *fmt, ...);
zos_err_t lcd_show_image(zos_uint16_t x, zos_uint16_t y, zos_uint16_t length, zos_uint16_t wide, const zos_uint8_t *p);


void lcd_enter_sleep(void);
void lcd_exit_sleep(void);
void lcd_display_on(void);
void lcd_display_off(void);

#endif
